#ifndef WIDGETVARIANT_H
#define WIDGETVARIANT_H

#include <DefineLibUiQt.h>
#include <QtWidgets/QWidget>
#include <QtCore/QString>
#include <QtCore/QList>
#include <QtCore/QVariant>
#include <EItemMetaProperty.h>
#include <EItemMetaFunction.h>

class LIB_UI_QT_DLL WidgetVariant : public QWidget
{
    Q_OBJECT

public:
    explicit WidgetVariant(QWidget *parent = 0);
    virtual ~WidgetVariant();
    virtual void refreshByProperty(EItemMetaPropertyPtr p);
    //call QObject::connect to enable slot function for value widget changed.
    virtual void buildConnect();
    //clear all connect of slot function. This is called in sub class's refreshByProperty function to avoid slot function calling when only want to refresh value widget.
    virtual void clearConnect();

    virtual void performFilt();

    void addFiltChildWidget(WidgetVariant* childPtr);
    void addFiltStr(const QString& filtStr);
    void filtWidget(const QString& filtStr);
    EItemMetaPropertyPtr getVariantProperty();

    // Property getProperty();
    // QString getModuleName();
signals:
    void signalVariantChanged(EItemMetaPropertyPtr p, EVariant oldValue);

protected:
    EItemMetaPropertyPtr m_property;//
    // Property m_property;
    QList<WidgetVariant*> m_filtChildWdgetList;
    QList<QString> m_filtStr;
    // QString m_moduleName;
};

#endif // WIDGETVARIANT_H
